package Day09;

import java.util.Scanner;

public class Example1 {

   /* private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        calcuate();
    }

    public static void calcuate(){
        System.out.println("请输入一个数字");
        int number1 = sc.nextInt();
        System.out.println("请输入第二个数字");
        int number2 = sc.nextInt();
        if(number2 == 0){
            throw new ArithmeticException("在除法中除数不能为零");
        }
        int result = number1 / number2;
        System.out.println(result);
    }*/


    public static Scanner s = new Scanner(System.in);

    public static void main(String[] args) {
        calculate();
    }


    public static void calculate(){
        System.out.println("请输入一个数字");
        int n1 = s.nextInt();
        System.out.println("请输入第二个数字");
        int n2 = s.nextInt();
        if(n2 == 0){
            throw new ArithmeticException("除法运算中除数不能为零");
        }
        int result = n1 / n2;

        System.out.println(result);
    }
}
